<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- jsonp实质就是我们自己定义函数，用script标签src属性传给服务器(函数由服务器调用) -->

    <script>
        //定义函数
        const fun = function (data) {
             //data为服务器调用时传递的参数
             console.log(data)
        }
        //利用script标签发送请求
        const script = document.createElement('script')
        script.src = 'https://www.baidu.com/sugrec?pre=1&p=3&ie=utf-8&json=1&prod=pc&from=pc_web&sugsid=36545,36673,36454,36453,36692,36165,36693,36698,36569,26350,36469&wd=a&req=2&csor=1&cb=fun&_=1656124416430'
        document.body.appendChild(script)
    </script>
</body>

</html>